<?php

	
    //default configuration
    $config =& JComponentHelper::getParams( 'com_nv' );
		 

    $gmapkey = $config->get( 'gmapkey' );
    $indonesianLat = '-1.0546279422758742';
    $indonesianLong = '115.0927734375';
    $secondzoom = 6;
    $objectName = 'Indonesia';
    
	
	$marker = 'http://www.google.com/mapfiles/marker.png';
	
	
	//add javascript
	$js1 = JURI::base().'components/com_nv/assets/js/prototype.js';
	$js2 = JURI::base().'components/com_nv/assets/js/effects.js';
	$js3 = JURI::base().'components/com_nv/assets/js/lightwindow.js';
	$js4 = JURI::base().'components/com_nv/assets/js/mootools.js';
	$js5 = JURI::base().'components/com_nv/assets/js/moodalbox.js';
	

	//add css
	$css1 = JURI::base().'components/com_nv/assets/css/lightwindow.css';
	$css5 = JURI::base().'components/com_nv/assets/css/default.css';	
	$css2 = JURI::base().'components/com_nv/assets/css/home.css';
	$css3 = JURI::base().'components/com_nv/assets/css/moodalbox.css';
	$css4 = JURI::base().'components/com_nv/assets/css/common.css';
	
		
?>

<script type="text/javascript" src="<?echo $js1 ?>"></script>
<script type="text/javascript" src="<?echo $js2 ?>"></script>
<script type="text/javascript" src="<?echo $js3 ?>"></script>
<!--
<script type="text/javascript" src="<?echo $js4 ?>"></script>
<script type="text/javascript" src="<?echo $js5 ?>"></script>
-->

<link rel="stylesheet" href="<?echo $css1 ?>" type="text/css" media="screen" />
<link rel="stylesheet" href="<?echo $css2 ?>" type="text/css" />
<link rel="stylesheet" href="<?echo $css3 ?>" type="text/css" />
<link rel="stylesheet" href="<?echo $css4 ?>" type="text/css" />



<script type="text/javascript">
function startGallery() {
var myGallery = new gallery($('myGallery'), {
timed: false
});
}
window.addEvent('domready', startGallery);
</script>




<div class="componentheading">Selamat Datang di NusantaraView</div>

<div id="svmap_canvas" ></div>


<div id="aboutnv" >


<div id="searchBox">
<fieldset>
<legend>Cari objek wisata</legend>
<form action="<? echo "index.php?option=com_nv&view=search" ?>" method="post" name="adminForm" id="adminForm">

<table class="admintable">
<tr>
<td align="right" class="key">
<input name="searchObj" type="text" />
</td>
<td>
<input name="searchBtn" type="submit" value="cari" />
</td>
</tr>
</table>


</form>
</fieldset>
</div>


</div>

<!--
<div id="restoranwidget">
<fieldset>
    <legend>Restoran</legend>

<table border="0">
  <tr>
    <td colspan="6"><strong><?echo $this->xml[1][nama_rest];?></strong></td>
  </tr>
  <tr>
    <td colspan="6"><strong><?echo $this->xml[1][alamat_rest];?></strong></td>
  </tr>
  <tr>
    <td colspan="6"><strong><?echo $this->xml[1][telp_rest];?></strong></td>
  </tr>
  <tr>
    <td colspan="6"><strong><?echo $this->xml[1][website_rest];?></strong></td>
  </tr>
  <tr>
      <td colspan="6" align="right">
      <a href="index2.php?option=com_nv&view=all&input=<?echo $this->kota ?>" rel="moodalbox 900 500" title="<?echo $this->kota?>">selengkapnya</a>
      </td>
  </tr>
</table>
</fieldset>
</div>
-->


<?
		if (!empty($this->datahotel)){
			
		
 			$items = $this->datahotel->get_items();

			$jumlah_hotel = $this->datahotel->get_item_quantity();
            $out = "hasil pencarian hotel di <strong>$this->kota</strong> : <br/><br/>";

            $i=1;
			foreach($items as $item)
			{
                if ($i<=5){
                    $out .= '<b><em>'.$item->get_title().'</em></b><br/>';
                    $out .= $item->get_description().'<br/><br/>';
                }
				$i++;

			}//end of foreach
		
?>
<div class="hotelwidget">
<fieldset>
    <legend>Hotel</legend>
	Sumber : http://www.indonesia-tourism.com/	
<?
     echo "<br />";
     echo $out;
     ?>
        <a href="index2.php?option=com_nv&view=allhotel&input=<?echo $this->kota ?>" rel="moodalbox 800 500" title="<?echo $_POST[field_cari]?>">selengkapnya</a>
     </fieldset>
<?} ?>

</div>

<div id="blogwidget">
<fieldset>
<legend>Blog</legend>
<? echo $this->datablog;?>
</fieldset>
</div>


<div id="videowidget">
<fieldset class="fieldset">
<legend>Video</legend>
<? foreach($this->datavid as $youtube)
{ ?>


 <a href="http://www.youtube.com/v/<? echo $youtube->linkvideo ?>" class="lightwindow page-options" params="lightwindow_width=425,lightwindow_height=340,lightwindow_loading_animation=false" title="<? echo $youtube->title ?>" >
 <img src="<? echo $youtube->thumbnail ?>" alt="<? echo $youtube->videoid ?>" class="imgVideo"/> </a>
<? }?>

</fieldset>
</div>


<div id="picwidget" >
<fieldset class="fieldset" >
<legend>Foto</legend>

<? foreach($this->datapic as $flickr)
{ ?>
  

  
	<a href="<? echo $flickr->url ?>" class="lightwindow page-options" title="<? echo $flickr->title ?>">
	<img src="<? echo $flickr->thumbnail ?>" alt="<? echo $flickr->title ?>" />
	</a> 
  
  <? }?>
</fieldset>
</div>

<div id="weatherwidget" >
<fieldset  >
<legend>Cuaca</legend>
<? foreach($this->dataweather as $weather)
{ ?>

<h1><?echo $weather->title; ?></h1>

<p><? echo "Description : ".$weather->description; ?></p>
<? }?>
</fieldset>
</div>


<div id="eventwidget" >
<fieldset >
<legend>Event</legend>

<? foreach($this->dataevent as $event)
{ ?>
<div class="eventItem">
<a href="<?echo $event->link ?>" class="linknv" target="_blank"></a>
<h1> <?echo $event->title; ?></h1>

<? echo $event->description; ?>

</div>


<? }?>

</fieldset>
</div>




   
   <script type="text/javascript"
            src="http://www.google.com/jsapi?key=ABQIAAAAv-Q_kEBkfiCATCzlRAdaGRTNmsdf8oJErPgj8pmeVh4CV1HAChSb33Y41XzJ4Qi3IF5zV1k8vveFcg"></script>

  
  <script type="text/javascript">
  google.load("maps", "2.x");
   
  // Call this function when the page has been loaded
   function initialize() {
    var map = new google.maps.Map2(document.getElementById("svmap_canvas"));
    map.setCenter(new google.maps.LatLng(<?echo $indonesianLat ?>, <? echo $indonesianLong?>), <?echo $secondzoom ?>);
    
    var myHtml = "<h4>Selamat Datang Di NusantaraView</h4> Situs mashup informasi pariwisata Indonesia ";
    
    
    var nvicon = new google.maps.Icon();
    nvicon.image = 'http://poss.its.ac.id/risetnv/markers/image.png'; 
    nvicon.shadow = '';
    nvicon.iconSize = new google.maps.Size(24,46);
    nvicon.iconAnchor = new google.maps.Point(12,46);
    nvicon.infoWindowAnchor = new google.maps.Point(5,0);
    var point = new google.maps.LatLng(<?echo $indonesianLat ?>, <? echo $indonesianLong?>);
    var markerOptions = {icon:nvicon, draggable: true};
    var marker = new google.maps.Marker(point,markerOptions);

    marker.openInfoWindowHtml(myHtml);
    map.addOverlay(marker);
    map.setUIToDefault();
	
	
	
    
  }
  
  function mapsLoaded(){
  
  }
  google.setOnLoadCallback(initialize);
  
</script>

  



